{% extends 'admin/master.html' %}
{% import 'admin/lib.html' as lib with context %}
{% import 'admin/adminlte/forms.html' as forms with context %}

{% block body %}
    <section class="content-header">
        <h1>{{ admin_view.name }}</h1>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        {% set modal_name = 'View' + ' #' + request.args.get('id') %}
                        {{ forms.form_header(modal_name, 'fa fa-eye', is_modal=False) }}
                        {% block details_search %}
                            {{ forms.form_search() }}
                        {% endblock %}
                    </div>
                    <div class="box-body">
                        {% block details_table %}
                            {{ forms.form_view(details_columns) }}
                        {% endblock %}
                    </div>
                    <div class="box-footer">
                        <div class="pull-left">
                            {% if return_url %}
                                <a href="{{ return_url }}" class="btn btn-default" role="button" data-dismiss="modal">
                                    <i class="fa fa-chevron-circle-left"></i> {{ _gettext('Back') }}
                                </a>
                            {% endif %}
                        </div>
                        <div class="pull-right">
                            {%- if admin_view.can_edit -%}
                                <a class="btn btn-warning"
                                   href="{{ get_url('.edit_view', id=request.args.get('id'), url=return_url) }}"
                                   title="{{ _gettext('Edit') }}">{{ _gettext('Edit') }}</a>
                            {%- endif -%}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
{% endblock %}

{% block tail %}
    {{ super() }}
    <script src="{{ admin_static.url(filename='admin/js/details_filter.js', v='1.0.0') }}"></script>
{% endblock %}
